<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The MultipleIterator class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="limititerator.valid.html">LimitIterator::valid</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="multipleiterator.attachiterator.html">MultipleIterator::attachIterator</a></div>
 <div class="up"><a href="spl.iterators.html">迭代器</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.multipleiterator" class="reference">

 <h1 class="title">The MultipleIterator class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.3.0)</p>


  <div class="section" id="multipleiterator.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    An Iterator that sequentially iterates over all attached iterators
   </p>
  </div>


  <div class="section" id="multipleiterator.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">MultipleIterator</strong>
     </span>
     
     <span class="oointerface">implements 
      <span class="interfacename"><strong class="interfacename">Iterator</strong></span>
     </span>

     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.multipleiterator.html#multipleiterator.constants.mit-need-any"><var class="varname">MIT_NEED_ANY</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.multipleiterator.html#multipleiterator.constants.mit-need-all"><var class="varname">MIT_NEED_ALL</var></a></var>
     <span class="initializer"> = 1</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.multipleiterator.html#multipleiterator.constants.mit-keys-numeric"><var class="varname">MIT_KEYS_NUMERIC</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.multipleiterator.html#multipleiterator.constants.mit-keys-assoc"><var class="varname">MIT_KEYS_ASSOC</var></a></var>
     <span class="initializer"> = 2</span>
    ;</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><a href="multipleiterator.construct.html" class="methodname">__construct</a></span>
    ([ <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$flags</code>
    <span class="initializer"> = MultipleIterator::MIT_NEED_ALL|MultipleIterator::MIT_KEYS_NUMERIC</span>
   </span>
  ] )</div>

    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.attachiterator.html" class="methodname">attachIterator</a></span>
    ( <span class="methodparam"><span class="type"><a href="class.iterator.html" class="type Iterator">Iterator</a></span> <code class="parameter">$iterator</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$infos</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.containsiterator.html" class="methodname">containsIterator</a></span>
    ( <span class="methodparam"><span class="type"><a href="class.iterator.html" class="type Iterator">Iterator</a></span> <code class="parameter">$iterator</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.countiterators.html" class="methodname">countIterators</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="multipleiterator.current.html" class="methodname">current</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.detachiterator.html" class="methodname">detachIterator</a></span>
    ( <span class="methodparam"><span class="type"><a href="class.iterator.html" class="type Iterator">Iterator</a></span> <code class="parameter">$iterator</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.getflags.html" class="methodname">getFlags</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="multipleiterator.key.html" class="methodname">key</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.next.html" class="methodname">next</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.rewind.html" class="methodname">rewind</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.setflags.html" class="methodname">setFlags</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="multipleiterator.valid.html" class="methodname">valid</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>


  </div>
  

  <div class="section" id="multipleiterator.constants">
   <h2 class="title">预定义常量</h2>
   <dl>


    
     <dt id="multipleiterator.constants.mit-need-any"><strong><code>MultipleIterator::MIT_NEED_ANY</code></strong></dt>

     <dd>

      <p class="para">
       Do not require all sub iterators to be valid in iteration.
      </p>
     </dd>

    

    
     <dt id="multipleiterator.constants.mit-need-all"><strong><code>MultipleIterator::MIT_NEED_ALL</code></strong></dt>

     <dd>

      <p class="para">
       Require all sub iterators to be valid in iteration.
      </p>
     </dd>

    

    
     <dt id="multipleiterator.constants.mit-keys-numeric"><strong><code>MultipleIterator::MIT_KEYS_NUMERIC</code></strong></dt>

     <dd>

      <p class="para">
       Keys are created from the sub iterators position.
      </p>
     </dd>

    

    
     <dt id="multipleiterator.constants.mit-keys-assoc"><strong><code>MultipleIterator::MIT_KEYS_ASSOC</code></strong></dt>

     <dd>

      <p class="para">
       Keys are created from sub iterators associated information.
      </p>
     </dd>

    

   </dl>

  </div>



 </div>

 





















































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="multipleiterator.attachiterator.html">MultipleIterator::attachIterator</a> — Attaches iterator information</li><li><a href="multipleiterator.construct.html">MultipleIterator::__construct</a> — Constructs a new MultipleIterator</li><li><a href="multipleiterator.containsiterator.html">MultipleIterator::containsIterator</a> — Checks if an iterator is attached</li><li><a href="multipleiterator.countiterators.html">MultipleIterator::countIterators</a> — Gets the number of attached iterator instances</li><li><a href="multipleiterator.current.html">MultipleIterator::current</a> — Gets the registered iterator instances</li><li><a href="multipleiterator.detachiterator.html">MultipleIterator::detachIterator</a> — Detaches an iterator</li><li><a href="multipleiterator.getflags.html">MultipleIterator::getFlags</a> — Gets the flag information</li><li><a href="multipleiterator.key.html">MultipleIterator::key</a> — Gets the registered iterator instances</li><li><a href="multipleiterator.next.html">MultipleIterator::next</a> — Moves all attached iterator instances forward</li><li><a href="multipleiterator.rewind.html">MultipleIterator::rewind</a> — Rewinds all attached iterator instances</li><li><a href="multipleiterator.setflags.html">MultipleIterator::setFlags</a> — Sets flags</li><li><a href="multipleiterator.valid.html">MultipleIterator::valid</a> — Checks the validity of sub iterators</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="limititerator.valid.html">LimitIterator::valid</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="multipleiterator.attachiterator.html">MultipleIterator::attachIterator</a></div>
 <div class="up"><a href="spl.iterators.html">迭代器</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
